public class Main {
    public static void main6(String[] args) {
        String s1 = "aabcdefg";

        int index =s1.lastIndexOf("abc",4);
        System.out.println(index);
        //KMP算法
        String s = String.valueOf(19.9);//把整型变为字符串
        System.out.println(s);
        System.out.println("++++++++++++++");
        int date = Integer.parseInt("198");//字符串转为整型
        System.out.println(date);
        System.out.println("=============");
        String s2 = "hello";
        String ret = s2.toUpperCase();//变为大写,不是在原来基础上,而是转为大写后,为一个新的对象,给ret
        System.out.println(ret);
        System.out.println(s2);
        System.out.println("================");
        String s3 = "HELLO";
        String ret2 = s2.toLowerCase();//变为小写
        System.out.println(ret2);
        System.out.println(s3);
    }
    public static void main1(String[] args) {
        String s1 = "abcabcefg";
        int index = s1.indexOf("abc",3);
        System.out.println(index);
        String s2 = "hello";
        int index1 = s2.indexOf('l',3);//指定位置查找
        //从头到后,查下标,第一次
        System.out.println(index1);
        for(int i=0;i<s1.length();i++){
            char ch = s1.charAt(i);
            System.out.println(ch);
        }
    }

    public static void main2(String[] args){
        String str = "hello";
        //字符串常量,没有\0 标记结尾
        System.out.println(str);

    }
    public static void main4(String[] args) {
        String str = "hello bir world";
        String[] ret = str.split(" ",2);
        for (int i = 0; i < ret.length; i++) {
            System.out.println(ret[i]);
        }
    }

}